import numpy as np

# 建立3行4列的Array
A = np.arange(12).reshape((3, 4))
print(A)
print()
"""
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])
"""

# 纵向分割
print(np.split(A, 2, axis=1))
print()

# 横向分割
print(np.split(A, 3, axis=0))
print()

# 不等量的分割解决办法为：np.array_split()
print(np.array_split(A, 3, axis=1))
print()

# 等于 print(np.split(A, 3, axis=0))  横向分割
print(np.vsplit(A, 3))
print()

# 等于 print(np.split(A, 2, axis=1))   纵向分割
print(np.hsplit(A, 2))
